package org.sg20.searchengine.search;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.sg20.parsename.ParseNameOutputKey;

import java.io.IOException;

public class SearchReducer extends Reducer<Text, Text, IntWritable, Text> {
    // There is nothing to do for reducer
    @Override
    protected void reduce(Text key, Iterable<Text> values, Reducer<Text, Text, IntWritable, Text>.Context context) throws IOException, InterruptedException {
        StringBuilder str = new StringBuilder();
        int cnt = 0;
        for(Text t:values){
            cnt++;
        }
        context.write(new IntWritable(cnt), key);
    }
}